function myBrowser() {
  //取得浏览器的userAgent字符串
  var userAgent = navigator.userAgent
  var isOpera = userAgent.indexOf('Opera') > -1
  //判断是否Opera浏览器
  if (isOpera) {
    return 'Opera'
  }
  //判断是否Firefox浏览器
  if (userAgent.indexOf('Firefox') > -1) {
    return 'FF'
  }
  //判断是否Chrome浏览器
  if (userAgent.indexOf('Chrome') > -1) {
    return 'Chrome'
  }
  //判断是否Safari浏览器
  if (userAgent.indexOf('Safari') > -1) {
    return 'Safari'
  }
  //判断是否IE浏览器
  if (userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1 && !isOpera) {
    return 'IE'
  }
  //判断是否Edge浏览器
  if (userAgent.indexOf('Trident') > -1) {
    return 'Edge'
  }
}
function SaveAs5(imgURL) {
  var oPop = window.open(imgURL, '', 'width=1, height=1, top=5000, left=5000')
  for (; oPop.document.readyState != 'complete'; ) {
    if (oPop.document.readyState == 'complete') break
  }
  oPop.document.execCommand('SaveAs')
  oPop.close()
}
export function oDownLoad(url) {
  myBrowser()
  console.log(myBrowser())
  if (myBrowser() === 'IE' || myBrowser() === 'Edge') {
    //IE





    SaveAs5(document.getElementById('downImg').src)
  } else {
    //!IE
    ele.href = url

    ele.download = ''
  }
}
